﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Shopping_List.Forms
{
    public partial class Text : Form
    {
        MainForm pubvars = new MainForm();
        public String[] Questions = {
            "What do you want to name this category?",
            "What do you want to name this item?",
            "What do you want to rename this category/item?",
            "What do you want to set the recent item count to?"};
        public String Result = "";
        public Text()
        {
            InitializeComponent();
        }

        public void LoadInput(int inputnum)
        {
            QuestionLabel.Text = Questions[inputnum];
        }
        bool CallFlag = false;
        private void Text_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (CallFlag == false)
            {
                DialogResult = System.Windows.Forms.DialogResult.Cancel;
            }
            else
            {
                DialogResult = System.Windows.Forms.DialogResult.OK;
                CallFlag = false;
            }
        }

        private void GoButton_Click(object sender, EventArgs e)
        {
            Result   = InsertText.Text;
            CallFlag = true;
            Close();
        }

        /////////////////
        //Special Stuff//
        /////////////////
        private void GoButton_MouseEnter(object sender, EventArgs e)
        {
            GoButton.BackColor = pubvars.Button_OverButton;
        }

        private void GoButton_MouseLeave(object sender, EventArgs e)
        {
            GoButton.BackColor = pubvars.ButtonPlain;
        }

        private void GoButton_MouseDown(object sender, MouseEventArgs e)
        {
            GoButton.BackColor = pubvars.ButtonDown;
        }

        private void GoButton_MouseUp(object sender, MouseEventArgs e)
        {
            GoButton.BackColor = pubvars.ButtonPlain;
        }
    }
}
